<?php
echo date("Y-m-d H:i:s").PHP_EOL;
$arr = [
	'aps' => 'https://www.aipanshi.com',
	'baidu' => 'https://www.baidu.com',
	'hello' => 'https://www.helloweba.net/php/581.html',
	'sf' => 'https://segmentfault.com/a/1190000018404357?utm_source=sf-related',
];

function bazhan($name,$url){
	sleep(1);
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

	$output = curl_exec($ch);
	file_put_contents($name.'.html',$output);
}

foreach($arr as $key=>$url){
	bazhan($key,$url);
}

echo date("Y-m-d H:i:s").PHP_EOL;